﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NIP.DynamicControl
{
    public enum ControlCommands
    {
        NULL= 0,
        MOVE_TO,
        LOOK_AT,
        POINT_TO,
        TEST_PID,
        ENABLE_PID,
        SET_PID,
        HOME,
        HELLO,
        ABORT,
        STOP,
        GRIP,
        DRAW,
        TAKE_PHOTO,
        CONTOUR_BUILD
    }
    public class ControlCommandResolver
    {
        public static ControlCommands TextToCommand(string text)
        {
            if (text.ToLower().IndexOf("move") >= 0)
            {
                return ControlCommands.MOVE_TO;
            }
            if (text.ToLower().IndexOf("look") >= 0)
            {
                return ControlCommands.LOOK_AT;
            }
            if (text.ToLower().IndexOf("point") >= 0)
            {
                return ControlCommands.POINT_TO;
            }
            if (text.ToLower().IndexOf("home") >= 0)
            {
                return ControlCommands.HOME;
            }
            if (text.ToLower().IndexOf("draw") >= 0)
            {
                return ControlCommands.DRAW;
            }
            if (text.ToLower().IndexOf("hello") >= 0)
            {
                return ControlCommands.HELLO;
            }
            return ControlCommands.NULL;
        }
    }
}
